Retrieve the query options whose name matches the name in the request URI, or retrieve the default query options.
Request Headers | |
---|---|
Accept* |
The expected MIME type of the information in the response.
Accepted types: application/json or
application/xml . Ignored if the request includes a
format parameter value.
|
Upon success, MarkLogic Server responds with a status 200 (OK) and returns the requested information in the response body, XML or JSON.
If the named configuration does not exist, MarkLogic Server returns a 404 status.
rest-reader
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/rest-reader
The response body contains a list of search:options
nodes,
expressed in either XML or JSON, depending upon the format
parameter or Accept header setting. For details on the options, see
PUT /v1/config/query/(default|{name})
.
The returned configuration does not include configuration inherited at runtime from the default or global query options.
The XML or JSON structure returned by this method is suitable for
passing to a PUT or POST request to /config/query
.
For more details, see Configuring Query Options in the REST Application Developer's Guide.
$ curl --anyauth --user user:password -X GET -i \ http://localhost:8000/v1/config/query/title ==> The query options previously saved under the name "title". For example: Server: MarkLogic Content-Type: text/plain; charset=UTF-8 Content-Length: 31 Connection: close HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 172 Connection: close <options xmlns="http://marklogic.com/appservices/search"> <constraint name="title"> <word> <element ns="" name="TITLE"/> </word> </constraint> </options>
$ curl --anyauth --user user:password -X GET -i -H "Accept: application/json" \ 'http://localhost:8000/v1/config/query/tuples' ==> The query options previously saved under the name "tuples". For example: Content-type: application/xml Server: MarkLogic Content-Length: 211 Connection: close HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/plain; charset=UTF-8 Content-Length: 271 Connection: close { "options": { "tuples": [ { "name": "speaker-title", "range": [ { "type": "xs:string", "element": { "ns": "", "name": "SPEAKER" } }, { "type": "xs:string", "path-index": { "text": "/PLAY/ACT/SCENE/TITLE" } } ] } ], "constraint": [ { "name": "title", "word": { "element": { "ns": "", "name": "TITLE" } } } ] } }